package org.graduates.webapp.actions.person;

import org.graduates.webapp.actions.BaseAction;
import org.projects.graduates.domain.Person;

/**
 * 访问某人的空间
 * 
 * @author Administrator
 * 
 */
public class SpaceAction extends BaseAction {

	private static final long serialVersionUID = 1309082906040805411L;

	private boolean guest;

	// 空间主人的ID
	private long pid = 0L;
	
	private Person person;

	public String execute() {
		//pid != 当前人员的id ，则是访客
		guest = getCurrentPerson().getId() == pid ? false : true;
		
		person = Person.get(Person.class, this.pid);
		
		return SUCCESS;
	}

	public boolean isGuest() {
		return guest;
	}

	public void setGuest(boolean guest) {
		this.guest = guest;
	}

	public long getPid() {
		return pid;
	}

	public void setPid(long pid) {
		this.pid = pid;
	}
	
	

	public Person getPerson() {
		return this.person;
	}

}
